/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author thuyhtp_b00491
 */
@Entity
@Table(name = "SeminarStatus")
@NamedQueries({
    @NamedQuery(name = "SeminarStatus.findAll", query = "SELECT s FROM SeminarStatus s"),
    @NamedQuery(name = "SeminarStatus.findById", query = "SELECT s FROM SeminarStatus s WHERE s.id = :id"),
    @NamedQuery(name = "SeminarStatus.findByStatus", query = "SELECT s FROM SeminarStatus s WHERE s.status = :status")})
public class SeminarStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "status")
    private String status;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "seminarStatus")
    private Collection<Event> eventCollection;

    public SeminarStatus() {
    }

    public SeminarStatus(Integer id) {
        this.id = id;
    }

    public SeminarStatus(Integer id, String status) {
        this.id = id;
        this.status = status;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Collection<Event> getEventCollection() {
        return eventCollection;
    }

    public void setEventCollection(Collection<Event> eventCollection) {
        this.eventCollection = eventCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SeminarStatus)) {
            return false;
        }
        SeminarStatus other = (SeminarStatus) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entities.SeminarStatus[id=" + id + "]";
    }

}
